using BasicScript.Component;
using Game.Core;
using Game.Main.Model;
using Game.Manager;

namespace Game.Component
{
	public class WindBellItem : BaseItem
	{
		private FrameAnimation frameAnim;

		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
			frameAnim = model.GetComponent<FrameAnimation>();
		}

		public override void QuicklyTouch(TouchEventData touchEventData)
		{
			base.QuicklyTouch(touchEventData);
			if (frameAnim != null && !frameAnim.isPlaying)
			{
				Singleton<AudioManager>.Instance.PlayAudio("sound_wind_bell", false, GetAudioPlayer());
				frameAnim.Play();
			}
		}
	}
}
